function Person(name) {
  this.name = name
  this.age = 28
}

function Person1() {
  this.name = 'lcj'
  this.age = 28
  return {
    adress: 'llslsl'
  }
}

// var p1 = new Person1()
// console.log(p1.name)
// console.log(p1.age)


// function Person2() {
//   this.name = 'lcj'
//   this.age = 28
//   return 'lcj你好'
// }

// var p2 = new Person2()
// console.log(p2.name)
// console.log(p2.age)

function moniNew() {
  var obj = {}
  Constructor = [].shift.call(arguments)
  obj._proto_ = Constructor.prototype
  var ret = Constructor.apply(obj, arguments) // 第二个参数是个数组

  return typeof ret == 'object' ? ret : obj
}

var p3 = moniNew(Person1, 'lcj')
console.log(p3.name)
console.log(p3.age)